x86/setup: move CPU0s stack out of the Xen text/data/bss virtual region
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 8 Jun 2015 12:16:27 +0000 (14:16 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 8 Jun 2015 12:16:27 +0000 (14:16 +0200)
commita92efb747bbf256c20278517dfc179ced84bb869
tree6e158e9f964313ace612f38e13445ef78d468325
parentcb7d7dd277fedd898db4a22ce929eb3d7d407567
x86/setup: move CPU0s stack out of the Xen text/data/bss virtual region

Currently, the BSP's stack is the BSS symbol cpu0_stack.  In builds using
memguard_stack(), a page gets shot out of the mappings.

To avoid shattering the superpage which will eventually map the BSS, use the
directmap virtual address of cpu0_stack, while still using the same underlying
physical memory.  (Xen has an order 21 physical relocation requirement meaning
that the order 3 alignment requirement for cpu0_stack will be honoured even
via its diretmap mapping.)

In addition, fix two issues exposed by the changes.

 * do_invalid_op() should use is_active_kernel_text() rather than having its
   own, different, idea of when to search through the bugframes.
 * Setting of system_state to active needs to be deferred until after code has
   left .init.text, for bugframes/backtraces to function in reinit_bsp_stack().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/setup.c
xen/arch/x86/traps.c